set(TARGET "termit")

# checking for guile http://www.gnu.org/software/guile/

INCLUDE_DIRECTORIES(${TERMIT_SOURCE_DIR})

INCLUDE(Sources.cmake)
INCLUDE(FindGuile.cmake)
FIND_GUILE(GUILE_LDFLAGS)
PKGCONFIG(gtk+-2.0 GTK_INCLUDE_DIR GTK_LIB_DIR GTK_LDFLAGS GTK_CFLAGS)
PKGCONFIG(vte VTE_INCLUDE_DIR VTE_LIB_DIR VTE_LDFLAGS VTE_CFLAGS)

SET(TERMIT_CFLAGS "${GTK_CFLAGS} ${VTE_CFLAGS}")
SET(TERMIT_LDFLAGS "${GTK_LDFLAGS} ${VTE_LDFLAGS} ${GUILE_LDFLAGS}")

IF(DEBUG)
  SET(TERMIT_CFLAGS "${TERMIT_CFLAGS} -D DEBUG")
ENDIF(DEBUG)

SET_SOURCE_FILES_PROPERTIES(${TERMIT_SRCS} PROPERTIES 
  COMPILE_FLAGS "${TERMIT_CFLAGS}")

ADD_EXECUTABLE(${TARGET} ${TERMIT_SRCS})

TARGET_LINK_LIBRARIES(${TARGET} "${TERMIT_LDFLAGS}")

INSTALL(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

